#ifndef __TCPSERVER_H__
#define __TCPSERVER_H__

#include "Acceptor.h"
#include "EventLoop.h"

namespace myNameSpace {
class TcpServer {
public:
    TcpServer(unsigned short port, const string &ip = "127.0.0.1");

    void setAllCallbacks(TcpConnectionCallback &&onNewConnection, TcpConnectionCallback &&onMessage, TcpConnectionCallback &&onClose);
    void start();
    void stop();

private:
    Acceptor _acceptor;
    EventLoop _eventLoop;
};
} // end of namespace myNameSpace

#endif
